<?php

namespace App\Console\Commands\ChatGroup;

use App\Console\Commands\Traits\ExcelCommandTrait;
use App\Service\ChatGroup\import\ChatFAQ;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command;

class ImportFAQ extends Command
{
    use ExcelCommandTrait;
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'chatGroup:import-faq {url}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '导入常见问题清单';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     * @throws GuzzleException
     */
    public function handle()
    {
        $url              = $this->argument('url');
        $this->inputExcel = false;
        $this->excelImport(ChatFAQ::class, $url);
    }
}
